/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package exercises.day04.pt02.RandomPhone;

import java.util.Random;

/**
 *
 * @author Jaice
 */
public class RandomPhone {

    public RandomPhone() {
        int[] num = new int[10];
        int i = 0;
        String phoneNum = "";
        //generate random integer
        Random randomGenerator = new Random();
        for (int x = 0; x <= 2; x++) {
            num[x] = randomGenerator.nextInt(7);
        }

        i = randomGenerator.nextInt(742);
        
        num[3] = i / 100;
        num[4] = (i % 100) / 10;
        num[5] = (i % 100) % 10;

        for (int x = 6; x <= 9; x++) {
            num[x] = randomGenerator.nextInt(9);
           
        }


        phoneNum = num[0] + "" + num[1] + "" + num[2] + "-" + num[3] + "" + num[4] + "" + num[5]
                + "-" + num[6] + "" + num[7] + "" + num[8] + ""+ num[9];

        System.out.println(phoneNum);


    }

    public static void main(String args[]) {

        RandomPhone rp = new RandomPhone();


    }
}
